package com.shixulin.controller;


import com.shixulin.domain.ResponseResult;
import com.shixulin.entity.PaperQuestion;
import com.shixulin.service.PaperQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/teacher")
@Component
public class PaperQuestionController {

    @Autowired
    private PaperQuestionService paperQuestionService;
    //保存试卷题目
    @PostMapping("/saveQuestions")
    public ResponseResult saveQuestions(@RequestBody List<PaperQuestion> paperQuestion){

        return paperQuestionService.saveQuestions(paperQuestion);
    }
    //删除创建失败的试卷
    @GetMapping("/deletePaperId/{paperId}")
    public ResponseResult deletePaperId(@PathVariable("paperId")int paperId){
        return paperQuestionService.deletePaperId(paperId);
    }
    //删除试卷题目
    @GetMapping("/deleteExamQuestion/{questionId}")
    public ResponseResult deleteExamQuestion(@PathVariable("questionId") int questionId){
        return paperQuestionService.deleteExamQuestion(questionId);
    }



}
